package util

import (
	"RedWork/util/errmsg"
	"github.com/gin-gonic/gin"
)

func HandleTokenCode(c *gin.Context) (status bool, data string, uidint int) {
	status = true
	data = ""
	code, _ := c.Get("token_code")
	if code != errmsg.SUCCSE {
		status = false
		c.JSON(200, gin.H{
			"status": status,
			"data":   errmsg.GetErrMsg(code.(int)),
		})
		c.Abort()
		return
	}
	uid, _ := c.Get("uid")
	uidint = uid.(int)
	return
}
